<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 14844
  Date: 2020/11/23
  Time: 15:23
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath(); %>
<html>
<script src="<%=path%>/heatconfig/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="<%=path%>/heatconfig/layui-v2.5.6/layui/layui.all.js"></script>
<head>
    <title>添加管理员</title>
</head>
<style>
    .layui-form-label{
        width: 100px;
    }
    .layui-input-block{
        margin-left: 130px;
    }
    .layui-form{
        margin-right: 30%;
    }
</style>
<body>
<div class="cBody">
    <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-block">
            <input type="text" id="adminName" required lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
            <input type="text" id="adminPass" required lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-block">
            <input type="text" id="passWord" required lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">设置角色</label>
        <div class="layui-input-block">
            <C:forEach items="${requestScope.roles}" var="role">
            <input type="checkbox" id="roles" value="${role.id}"  required lay-verify="required" autocomplete="off" class="layui-input">
                <div>${role.name}</div><br>
            </C:forEach>
        </div>
    </div>


    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="submit" value="提交" id="sub">
            <%--                <button class="layui-btn" lay-submit lay-filter="submitBut">立即提交</button>--%>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>



    <script>
        $(function () {
            $("#sub").click(function () {
                chargebackApplyFor();
            });

        })
        function chargebackApplyFor()
        {
            var workerId=$("#workerId").val();
            var orderId=$("#orderId").val();
            var reason=$("#reason").val();
            alert(workerId,orderId,reason)
            alert(workerId,reason,orderId);
            $.ajax({
                url:"<%=path%>/chargebackApplyFor",
                data:{"workerId":workerId,"orderId":orderId,"reason":reason},
                success:function () {
                    window.parent.location = window.parent.location.href;
                }
            })
        }
        layui.use(['upload','form'], function() {
            var form = layui.form;
            var upload = layui.upload;
            var layer = layui.layer;
            //监听提交
            form.on('submit(submitBut)', function(data) {
                return false;
            });
            form.verify({
                //数组的两个值分别代表：[正则匹配、匹配不符时的提示文字]
                ZHCheck: [
                    /^[\u0391-\uFFE5]+$/
                    ,'只允许输入中文'
                ]
            });
            //拖拽上传

        });
    </script>

</div>
</body>
</html>
